package level.editor.tool.tile;

import level.editor.command.Command;
import level.editor.command.RequiresModify;
import level.editor.command.RequiresModule;
import level.editor.command.RequiresUpdate;
import level.editor.mediator.Module;
import level.editor.state.StateModule;
import level.state.StateHandler;
import level.state.Tile;

public class TileAddCommand extends Command implements RequiresUpdate, RequiresModify, RequiresModule
{
	private Tile tile;
	private String layerName;

	public TileAddCommand(Tile tile, String layerName)
	{
		super("StateModule");
		this.tile = tile;
		this.layerName = layerName;
	}

	public void execute(Module module)
	{
		// SOMEWHERE HERE YOU WANT TO REQUEST A LOCK OBJECT
		StateHandler.addTile(((StateModule) module).getState(), layerName, tile);
		((StateModule) module).createMemento();
	}
	
}
